package com.ambimmort.shj.action.send.policy;

import cn.net.greenet.db.HibernateUtil;
import com.ambimmort.shj.service.send.policy.SendPolicyService;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Josh on 2015/7/30.
 */
@Controller("/action/policy/send_policy_ucagent.do")
public class SendPolicyUcAgent {
    @Autowired
    private SendPolicyService sendPolicyService;


    @RequestMapping("/action/policy/send_policy_ucagent.do")
    @ResponseBody
    public String sendPolicyUcAgent_policy(HttpServletRequest request,HttpServletResponse response){
//        SessionFactory sf = HibernateUtil.getSessionFactory();
//        Session session = sf.openSession();
//        session.clear();
//        try {
          return sendPolicyService.sendPolicyUcAgent();
//            return "{\"result\":\"true\"}";
//        } catch (Exception e) {
//            e.printStackTrace();
//            return "{\"result\":\"false\"}";
//        }
//        finally {
//            session.close();
//        }
    }
}
